home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / ead / ead15.dms / ead15.adf / Listati / Oops!.c < prev    next >
C/C++ Source or Header  |  1989-05-06  |  3KB  |  101 lines

  1. /* *************************************************************************
  2.  
  3. Programma ...... Oops!
  4. Versione ....... 1.00i - (7/8/1987...6/5/1989)
  5. Autori ......... Magic Ceee (Joerg Anslik)
  6. Scopo .......... Modificare il colore del Workbench a striscie
  7. Software ....... Aztec C V3.6a || Lattice C V5.02
  8. Hardware ....... Amiga 512K, Kickstart V1.2
  9. Compilazione ... cc +C +D +L Oops! -- ln oops!.o cl32.lib
  10. Note ........... Debug, traduzione ed adattamento di Luigi Callegari
  11.  
  12. ************************************************************************ */
  13.  
  14. #include "exec/types.h"
  15. #include "exec/memory.h"
  16. #include "graphics/gfxbase.h"
  17. #include "graphics/copper.h"
  18. #include "graphics/gfxmacros.h"
  19. #include "hardware/custom.h"
  20. #include "intuition/intuition.h"
  21.  
  22. #ifdef LATTICE
  23. #include <string.h>
  24. #include <proto/exec.h>
  25. #include <proto/graphics.h>
  26. #include <proto/intuition.h>
  27. #else
  28. #include <functions.h>
  29. #endif
  30.  
  31. #define NO_INTUI    "Intuition non si apre!\n"
  32. #define NO_GFX        "Graphics non si apre!\n"
  33.  
  34. struct IntuitionBase    *IntuitionBase;
  35. struct GfxBase        *GfxBase;
  36. struct ViewPort        *MagicView;
  37. struct UCopList     *MagicList;
  38. extern struct Custom     custom;
  39.  
  40. /* 
  41. y[] = Posizione verticale del pennello di scansione elettronica video
  42. col[] = Tabella dei colori: inizia da $000 (nero), finisce $FFF (blu)
  43. ********************************************************************* */
  44.  
  45. static int pos[] = { 0,12,18,24,30,36,42,48,54,60,66,72,78,84,90,96,102,108,
  46.              114,120,126,132,138,144,150,156,162,168,174,180,188,194 };
  47.  
  48. static int col[] = { 0x000,0x001,0x002,0x003,0x004,0x005,0x006,0x007,0x008,
  49.                0x009,0x00a,0x00b,0x00c,0x00d,0x00e,0x00f,0x00f,0x00e,
  50.                0x00d,0x00c,0x00b,0x00a,0x009,0x008,0x007,0x006,0x005,
  51.                0x004,0x003,0x002,0x001,0x000 };
  52.  
  53. void _main()
  54. {
  55. register int i;
  56.  
  57. if(!(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library",0)))
  58. {
  59.     Write(Output(),NO_INTUI,strlen(NO_INTUI));
  60.     _exit( 10L ); 
  61. }
  62.  
  63. if(!(GfxBase=(struct GfxBase *)OpenLibrary("graphics.library",0)))
  64. {
  65.     Write(Output(),NO_GFX,strlen(NO_GFX));
  66.     CloseLibrary((struct Library *)IntuitionBase);
  67.     _exit( 11L );
  68. }
  69.  
  70. MagicView = GfxBase -> ActiView->ViewPort; /* ViewPort corrente*/
  71.  
  72. MagicList =(struct UCopList *)AllocMem(sizeof(struct UCopList),\
  73.                     MEMF_PUBLIC|MEMF_CLEAR);
  74.  
  75. /* Il seguente ciclo aggiusta la tabella per i modelli PAL
  76. purche' il fondo dello schermo sia nero */
  77.  
  78. /*
  79. for ( i = 0 ; i < 31 ; i++ )
  80.     pos[ i ] += 30;
  81. */
  82.  
  83. for( i = 0; i < 31; i++ )
  84. {
  85.     CWAIT(MagicList,pos[i],0);        /* Attende sino pos[i] */
  86.     CMOVE(MagicList,custom.color[0],col[i]);/* Usa nuovo colore */
  87. }
  88.  
  89. CEND(MagicList);    /* Installata nuova UCopList */
  90.  
  91. MagicView -> UCopIns = MagicList;    /* Informa Copper della nuova lista */
  92.  
  93. RethinkDisplay();
  94.  
  95. CloseLibrary((struct Library *)IntuitionBase);
  96. CloseLibrary((struct Library *)GfxBase);
  97. _exit( 0L );
  98. }
  99.  
  100. /* ********************************* E O F ************************** */
  101.